package com.atguigu.gulimall.product.feign;

import com.atguigu.common.to.SkuReductionTo;
import com.atguigu.common.to.SpuBoundTo;
import com.atguigu.common.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient("gulimall-coupon")
public interface ConponFeignService {

    /**
     * feign远程调用参数变换过程：
     *     实体类（调用传参）-->json（参数运输）-->实体类（参数封装：@RequestBody）
     *     只要前后两个实体类有相同属性，@RequestBody都会成功封装实体类，不考虑实体类相不相同
     * @param spuBoundTo
     * @return
     */
    @PostMapping("coupon/spubounds/save")
    R saveSpuBounds(@RequestBody SpuBoundTo spuBoundTo);

    @PostMapping("coupon/skufullreduction/saveinfo")
    R saveSkuBounds(@RequestBody SkuReductionTo skuReductionTo);
}
